uses dots in directory names...)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3895
f51c46e8-681c-474f-0cfe-
069cfd0219fb
static void
wr_init(const char *fname) {
- char *dot;
+ char *dot, *slash;
ofname = xstrdup(fname);
- // If user provided an extension, whack it.
- dot = strchr(ofname, '.');
- if (dot) *dot = 0;
+ // If user provided an extension in the pathname, whack it.
+ dot = strrchr(ofname, '.');
+ slash = strrchr(ofname, GB_PATHSEP);
+ if (dot > slash) *dot = 0;
static char valid_chars [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"
".-/\\~@#$%^&*()_+=<>"